package gen;

import com.nebutown.generation.BeanSpec;
import org.junit.Test;

import static com.nebutown.generation.BeanSpec.listOf;

public class DataGen {
    private static final String PACKAGE_NAME = "com.restaurant.application.minifacade.data";
    private static final String DESTINATION = "src/main/java/";

    private static void generate(BeanSpec def) {
        def.generate(DESTINATION);
    }

    @Test
    public void test1() {
        generate(new BeanSpec(PACKAGE_NAME, "PersonBO")
                .add("nickName", String.class)
                .add("gender", String.class)
                .add("birthday", String.class)
                .add("phone", String.class)
                .add("id", String.class)
        );
    }

    @Test
    public void test2() {
        generate(new BeanSpec(PACKAGE_NAME, "MainBO")
                .add("nickName", String.class)
                .add("avatarUrl", String.class)
                .add("level", String.class)
                .add("levelName", String.class)
                .add("memberDetail", String.class)
                .add("integral", Integer.class)
                .add("integralDetail", String.class)
                .add("personNumber", String.class)
                .add("erCode", String.class)
                .add("lists", listOf("CardBO"))
        );
    }

    @Test
    public void cardList() {
        generate(new BeanSpec(PACKAGE_NAME, "CardListBO")
                .add("lists", listOf("CardBO"))
        );
    }

    @Test
    public void test3() {
        generate(new BeanSpec(PACKAGE_NAME, "CardBO")
                .add("cardId", String.class)
                .add("content", String.class)
                .add("cardType", String.class)
                .add("fullMoney", Double.class)
                .add("minusMoney", Double.class)
                .add("endTime", String.class)
                .add("erCode", String.class)
                .add("remark", String.class)
                .add("version", Integer.class)
        );
    }

    @Test
    public void test4() {
        generate(new BeanSpec(PACKAGE_NAME, "SignInBO")
                .add("message", String.class)
                .add("integral", Integer.class)
        );
    }

    @Test
    public void test5() {
        generate(new BeanSpec(PACKAGE_NAME, "ReservationListBO")
                .add("lists", listOf("ReservationPageBO"))
        );
    }

    @Test
    public void test6() {
        generate(new BeanSpec(PACKAGE_NAME, "ReservationBO")
                .add("lists", listOf("ShopBookingTime"))
        );
    }

    @Test
    public void shopBookingTime() {
        generate(new BeanSpec(PACKAGE_NAME, "ShopBookingTime")
                .add("shopId", String.class)
                .add("shopName", String.class)
                .add("bookingTime", listOf("BookingTime"))
                .add("services", listOf("String"))
        );
    }

    @Test
    public void bookingTime() {
        generate(new BeanSpec(PACKAGE_NAME, "BookingBO")
                .add("shops", listOf("ShopBO"))
                .add("service", listOf("String"))
        );
    }

    @Test
    public void bookingFirst() {
        generate(new BeanSpec(PACKAGE_NAME, "BookingTime")
                .add("date", String.class)
                .add("time", listOf("String"))
                .add("service", listOf("String"))
        );
    }

    @Test
    public void test7() {
        generate(new BeanSpec(PACKAGE_NAME, "ShopListBO")
                .add("lists", listOf("ShopBO"))
        );
    }

    @Test
    public void test8() {
        generate(new BeanSpec(PACKAGE_NAME, "ShopBO")
                .add("shopId", String.class)
                .add("shopName", String.class)
                .add("address", String.class)
                .add("phone", String.class)
                .add("imgUrl", String.class)
        );
    }

    @Test
    public void test9() {
        generate(new BeanSpec(PACKAGE_NAME, "TypeListBO")
                .add("lists", listOf("TypeBO"))
        );
    }

    @Test
    public void test10() {
        generate(new BeanSpec(PACKAGE_NAME, "TypeBO")
                .add("typeId", String.class)
                .add("typeName", String.class)
        );
    }

    @Test
    public void test11() {
        generate(new BeanSpec(PACKAGE_NAME, "GoodsListBO")
                .add("lists", listOf("GoodsBO"))
        );
    }

    @Test
    public void test12() {
        generate(new BeanSpec(PACKAGE_NAME, "GoodsBO")
                .add("goodsId", String.class)
                .add("name", String.class)
                .add("price", String.class)
                .add("integral", Long.class)
                .add("numberLimit", Integer.class)
                .add("fromTime", Long.class)
                .add("endTime", Long.class)
                .add("imgUrl", String.class)
                .add("description", String.class)
        );
    }

    @Test
    public void test13() {
        generate(new BeanSpec(PACKAGE_NAME, "GoodsPageBO")
                .add("lists", listOf("ShopGoodsBO"))
                .add("integral", Long.class)
        );
    }

    @Test
    public void test14() {
        generate(new BeanSpec(PACKAGE_NAME, "ShopGoodsBO")
                .add("shopId", String.class)
                .add("shopName", String.class)
                .add("types", listOf("TypeBO"))
                .add("goods", listOf("GoodsBO"))
        );
    }

    @Test
    public void pageBean1() {
        generate(new BeanSpec(PACKAGE_NAME, "RegisterBO")
                .add("phone", String.class)
                .add("verifyCode", String.class)
                .add("wxCode", String.class)
                .add("nickName", String.class)
                .add("avatarUrl", String.class)
                .add("gender", Integer.class)
                .add("city", String.class)
                .add("province", String.class)
                .add("country", String.class)
                .add("unionId", String.class)
        );
    }

    @Test
    public void pageBean2() {
        generate(new BeanSpec(PACKAGE_NAME, "SearchGoodsBO")
                .add("shopId", String.class)
                .add("typeId", String.class)
                .add("content", String.class)
        );
    }

    @Test
    public void pageBean3() {
        generate(new BeanSpec(PACKAGE_NAME, "IdBO")
                .add("id", String.class)
        );
    }

    @Test
    public void pageBean4() {
        generate(new BeanSpec(PACKAGE_NAME, "PhoneBO")
                .add("phone", String.class)
                .add("code", String.class)
        );
    }

    @Test
    public void pageBean5() {
        generate(new BeanSpec(PACKAGE_NAME, "StatusBO")
                .add("status", String.class)
        );
    }

    @Test
    public void pageBean6() {
        generate(new BeanSpec(PACKAGE_NAME, "ReservationPageBO")
                .add("orderId", String.class)
                .add("createTime", Long.class)
                .add("shopDate", String.class)
                .add("shopTime", String.class)
                .add("service", String.class)
                .add("status", String.class)
                .add("shopId", String.class)
                .add("shopName", String.class)
                .add("count", Integer.class)
                .add("remark", String.class)
        );
    }

    @Test
    public void consumptionList() {
        generate(new BeanSpec(PACKAGE_NAME, "ConsumptionListBO")
                .add("lists", listOf("ConsumptionBO"))
        );
    }

    @Test
    public void consumption() {
        generate(new BeanSpec(PACKAGE_NAME, "ConsumptionBO")
                .add("content", String.class)
                .add("payTime", Long.class)
                .add("integral", Long.class)
                .add("money", Double.class)
        );
    }

    @Test
    public void bookingPageBO() {
        generate(new BeanSpec(PACKAGE_NAME, "BookingPageBO")
                .add("shopId", String.class)
                .add("service", String.class)
        );
    }

}
